<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日常开支</title>
<jsp:include page="/header.jsp"></jsp:include>
<link href="${basePath }/css/ui.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
	$(function() {
		$( "#tabs" ).tabs();
		
		//$("a").button();
		
		$("form").find("a:eq(1)").button().click(function() {
			$("form").find("input,textarea").val("");
		})
		
		$("form").find("a:eq(0)").button().click(function() {
			$.ajax({
				url:"${basePath}/daily/save.htm",
				type:"post",
				data:$("form").serialize(),
				dataType:"json"
			}).done(function(data){
				$.jqalert(data.msg, "提示", function() {
					if(data.isSuccess) 
						window.location = window.location;
				})
			})
		})
		
	})
	
	function turnPage(page) {
		$("#daily_list").load("${basePath}/daily/list.htm?pageNo="+page);
	}
	
</script>
</head>
<body>
    <div class="main">
        <div class="cont">
        	<div id="tabs">
				<ul>
					<li><a href="#tabs-1">日常开支</a></li>
					<li><a href="#tabs-2">开支记录</a></li>
				</ul>
				<div id="tabs-1">
				<form>
					<table>
						<tr>
							<th>开支门店：</th><td>${store_name }</td>
						</tr>
						<tr>
							<th>开支金额：</th><td><input type="text" name="amount"></td>
						</tr>
						<tr>
							<th>备注：</th><td>
								<textarea name="remark" cols="20" rows="5"></textarea>
							</td>
						</tr>
						<tr>
							<td colspan="2"><a href="javascript:;"">提交</a>
							<a href="javascript:;"">清空</a></td>
						</tr>
					</table>
				</form>
				</div>
				<div id="tabs-2">
					<div id="daily_list">
					<jsp:include page="list.jsp"></jsp:include>
					</div>
				</div>
			</div>
        </div>
    </div>
</body>
</html>